//
//  StoreQueryModel.swift
//
//  Created by 邱仙凯 on 2019/1/16
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public class ZyaStoreQueryModel: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let qcKc = "qc_kc"
    static let sGoodsCode = "s_goods_code"
    static let sGoodsId = "s_goods_id"
    static let bqRk = "bq_rk"
    static let bqSaleCk = "bq_sale_ck"
    static let bqPd = "bq_pd"
    static let sGoodsSpec = "s_goods_spec"
    static let bqJc = "bq_jc"
    static let sGoodsBz = "s_goods_bz"
    static let bqOutCk = "bq_out_ck"
    static let kfName = "kf_name"
    static let bqCk = "bq_ck"
    static let warehouseNm = "warehouse_nm"
    static let sGoodsUnit = "s_goods_unit"
  }

  // MARK: Properties
  public var qcKc: String?
  public var sGoodsCode: String?
  public var sGoodsId: String?
  public var bqRk: String?
  public var bqSaleCk: String?
  public var bqPd: String?
  public var sGoodsSpec: String?
  public var bqJc: String?
  public var sGoodsBz: String?
  public var bqOutCk: String?
  public var kfName: String?
  public var bqCk: String?
  public var warehouseNm: String?
  public var sGoodsUnit: String?

  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public required init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public func mapping(map: Map) {
    qcKc <- map[SerializationKeys.qcKc]
    sGoodsCode <- map[SerializationKeys.sGoodsCode]
    sGoodsId <- map[SerializationKeys.sGoodsId]
    bqRk <- map[SerializationKeys.bqRk]
    bqSaleCk <- map[SerializationKeys.bqSaleCk]
    bqPd <- map[SerializationKeys.bqPd]
    sGoodsSpec <- map[SerializationKeys.sGoodsSpec]
    bqJc <- map[SerializationKeys.bqJc]
    sGoodsBz <- map[SerializationKeys.sGoodsBz]
    bqOutCk <- map[SerializationKeys.bqOutCk]
    kfName <- map[SerializationKeys.kfName]
    bqCk <- map[SerializationKeys.bqCk]
    warehouseNm <- map[SerializationKeys.warehouseNm]
    sGoodsUnit <- map[SerializationKeys.sGoodsUnit]
  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = qcKc { dictionary[SerializationKeys.qcKc] = value }
    if let value = sGoodsCode { dictionary[SerializationKeys.sGoodsCode] = value }
    if let value = sGoodsId { dictionary[SerializationKeys.sGoodsId] = value }
    if let value = bqRk { dictionary[SerializationKeys.bqRk] = value }
    if let value = bqSaleCk { dictionary[SerializationKeys.bqSaleCk] = value }
    if let value = bqPd { dictionary[SerializationKeys.bqPd] = value }
    if let value = sGoodsSpec { dictionary[SerializationKeys.sGoodsSpec] = value }
    if let value = bqJc { dictionary[SerializationKeys.bqJc] = value }
    if let value = sGoodsBz { dictionary[SerializationKeys.sGoodsBz] = value }
    if let value = bqOutCk { dictionary[SerializationKeys.bqOutCk] = value }
    if let value = kfName { dictionary[SerializationKeys.kfName] = value }
    if let value = bqCk { dictionary[SerializationKeys.bqCk] = value }
    if let value = warehouseNm { dictionary[SerializationKeys.warehouseNm] = value }
    if let value = sGoodsUnit { dictionary[SerializationKeys.sGoodsUnit] = value }
    return dictionary
  }

}
